<?php
/*
 * @Description: 
 * @Author: Leequik
 * @Date: 2024-02-08 19:10:04
 * @LastEditTime: 2025-07-23 23:02:36
 * @LastEditors: Leequik
 */

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     * 任务调度可以写在这里，也可以在app/Console/Commands目录下创建新的命令。
     */
    protected function schedule(Schedule $schedule): void
    {
        // $schedule->command('inspire')->hourly();
        //$schedule->command('test:event')->everyMinute();
        $schedule->call(function () {
            echo 'Two Minutes Later'.date('Y-m-d H:i:s');
        })->everyTwoMinutes();
    }

    /**
     * 
     * Register the commands for the application.
     */
    protected function commands(): void
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
